<?php

require "database.php";

$__f__=file_get_contents("demo.json");
$__f__=json_decode($__f__,1);
$id=$_POST["id"];
for ($i = 0; $i < count($__f__["modelist"]); $i++) {
    if($__f__["modelist"][$i]["id"]==$id){
        $__f__["mode"]=$__f__["modelist"][$i]["name"];
        break;
    }
}
file_put_contents("demo.json",json_encode($__f__,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE));

